package top.kaoshanji.r2ch07h;

/**
 * 代码清单-r2ch07h-267页a：增强问题测试，greetTo方法被增强了但是在内部被调用
 * @author kaoshanji
 * ^_^
 * create time 2025/5/8 14:33
 */
public class Waiter implements BeanSelfProxyAware {

    private Waiter waiter;

    @Override
    public void setSelfProxy(Object object) {
        waiter = (Waiter) waiter;
    }

    public void greetTo(String name) {
        System.out.println("waiter greet to "+name+"...");
    }

    /**
     * greetTo方法被增强了但是在内部被调用
     * @param name
     */
    public void serveTo(String name){
        System.out.println("waiter serving "+name+"...");
        greetTo(name);
    }

}
